<template>
  <div class="hello">
    <!-- 轮播图 -->
    <mt-swipe>
      <mt-swipe-item v-for="(item, index) in msg" :key="index">
        <img :src="item.img" width="100%" height="100%" />
      </mt-swipe-item>
    </mt-swipe>
    <!-- 九宫格——六宫格 -->
    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <router-link to="xinwen">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../images/menu1.png" width="50%" />
            <div class="mui-media-body">新闻资讯</div>
          </a>
        </li>
      </router-link>
      <router-link to="tupian">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../images/menu2.png" width="50%" />
            <div class="mui-media-body">图片分享</div>
          </a>
        </li>
      </router-link>
      <router-link to="shangping">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../images/menu3.png" width="50%" />
            <div class="mui-media-body">商品购买</div>
          </a>
        </li>
      </router-link>
      <router-link to="liuyan">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../images/menu4.png" width="50%" />
            <div class="mui-media-body">留言反馈</div>
          </a>
        </li>
      </router-link>
      <router-link to="shiping">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../images/menu5.png" width="50%" />
            <div class="mui-media-body">视频专区</div>
          </a>
        </li>
      </router-link>
      <router-link to="bangzhu">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../images/menu6.png" width="50%" />
            <div class="mui-media-body">联系我们</div>
          </a>
        </li>
      </router-link>
    </ul>
  </div>
</template>

<script>
import { Toast } from "mint-ui";
export default {
  name: "HelloWorld",
  data() {
    return {
      msg: []
    };
  },
  methods: {
    getlw() {
      this.$ajax
        .get("api/getlunbo")
        .then(result => {
          this.msg = result.data.message;
        })
        .catch(err => {});
    }
  },
  created() {
    // if (this.msg) {
    //   Toast({
    //     message: "努力加载中...",
    //     position: "bottom"
    //   });
    // }
    this.getlw();
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.hello {
  height: 1200px;
}
.mint-swipe {
  height: 200px;
}
.mui-table-view-cell {
  width: 33.333%;
  border: none !important;
}
.mui-grid-view {
  background-color: #fff;
}
</style>
